package com.school.repair.service;

import com.school.repair.dao.TodoDao;
import com.school.repair.entity.Todo;
import com.school.repair.util.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service
public class TodoService {

    @Resource
    TodoDao todoDao;
    public Page<Todo> todoSearch(int pageNo, int pageSize, String createdate, int status, String name) {
            List<Todo> list = todoDao.todoSearch(pageNo, pageSize, createdate, status, name);
            int total = todoDao.searchTotal(createdate, status, name);
            return new Page<Todo>(total, list, pageNo);
    }
/*
    public Page<Todo> todoSearch(int pageNo, int pageSize, Date createdate, int status, String name) {
            List<Todo> list = todoDao.todoSearch(pageNo, pageSize, createdate, status, name);
            int total = todoDao.searchTotal(createdate, status, name);
            return new Page<Todo>(total, list, pageNo);
    }
*/

    public int add(Todo td) {
            return todoDao.add(td);
    }
}
